// 关于频道请求
import request from '@/utils/request.js'

/**
 * 获取全部频道
 * @returns
 */
export const getAllChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels'
  })
}

/**
 * 编辑或新增频道
 * @param {*} channel { id, seq }
 * @returns
 */
export const addMyChannels = channel => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [channel]
    }
  })
}

/**
 * 移除我的某个频道
 * @param {*} channelId 频道id
 * @returns
 */
export const removeMyChannels = channelId => {
  return request({
    method: 'DELETE',
    url: '/v1_0/user/channels/' + channelId
  })
}
